home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
et
/
et3_0-a1.lha
/
et3
/
src
/
ObjInt.h
< prev
next >
Wrap
C/C++ Source or Header
|
1992-04-27
|
911b
|
48 lines
#ifndef ObjInt_First
#ifdef __GNUG__
//pragma once
#pragma interface
#endif
#define ObjInt_First
#include "Object.h"
//---- ObjInt ------------------------------------------------------------------
class ObjInt: public Object {
int val;
public:
MetaDef(ObjInt);
ObjInt(int v= 0)
{ val= v; }
int GetValue()
{ return val; }
int SetValue(int newval)
{ val= newval; Changed(); return val; }
int operator= (int newval)
{ return SetValue(newval); }
int operator++ ()
{ return SetValue(GetValue()+1); }
int operator-- ()
{ return SetValue(GetValue()-1); }
operator int()
{ return val; }
//---- comparing
u_long Hash();
bool IsEqual(Object*);
int Compare(Object*);
//---- converting
char* AsString();
//---- activation passivation
OStream& PrintOn(OStream&);
IStream& ReadFrom(IStream&);
};
#endif